package com.mspbots.cw.request;

import com.fasterxml.jackson.databind.node.ObjectNode;
import com.mspbots.dto.BaseDTO;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * com.mspbots.cw.request.TenantUser
 *
 * @author Alex bob(https://github.com/vnobo)
 * @date Created by 2019/6/28
 */
@Data
public class TenantUserDTO implements BaseDTO {

    private Long id;
    private Long tenantId;
    private Long cwUid;
    private Long tenantRoleId;
    private String firstname;
    private String lastname;
    private String email;
    private LocalDateTime createDate;
    private ObjectNode extend;
    private Long manager;
    private String software;

    public TenantUserDTO() {
    }

    private TenantUserDTO(Long tenId, Long cwUid, Long tenRoleId,
                          String firstname, String lastname,
                          String email, ObjectNode extend, Long manager, String software) {
        this.tenantId = tenId;
        this.cwUid = cwUid;
        this.tenantRoleId = tenRoleId;
        this.firstname = firstname;
        this.lastname = lastname;
        this.email = email;
        this.extend = extend;
        this.manager = manager;
        this.software = software;
    }


    public static TenantUserDTO of(long tenId, long cwUid, long tenRoleId,
                                   String firstname, String lastname,
                                   String email, ObjectNode extend, long manager, String software) {
        return new TenantUserDTO(tenId, cwUid, tenRoleId,
                firstname, lastname, email, extend, manager, software);
    }
}
